import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:my_app/app/core/theme/app_colors.dart';
import 'package:my_app/app/routes/pages.dart';
import 'package:my_app/app/widgets/cell/custom_tile_widget.dart';

/// tool_page.dart
///
/// Created by fuchuanwei on Tue Feb 21 2023.
///
/// Description: 工具页面
///
class ToolPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text('工具')),
        body: ListView(
          children: [
            CustomTileWidget(
              title: 'GetX',
              subTitle: "高性能的状态管理、智能的依赖注入和便捷的路由管理。",
              assetImageName: "assets/images/getx.png",
              onTap: () => Get.toNamed(Routes.GETX),
            ),
            Divider(
              height: 2,
              color: dividerColor,
              thickness: 0.5,
            ),
            CustomTileWidget(
              title: 'Dio',
              subTitle: "dio 是一个强大的 Dart HTTP 请求库",
              assetImageName: "assets/images/dio.png",
              onTap: () => Get.toNamed(Routes.DIO),
            ),
            Divider(
              height: 2,
              color: dividerColor,
              thickness: 0.5,
            ),
            CustomTileWidget(
              title: 'Shared Preferences',
              subTitle: "为简单数据包装特定于平台的持久存储",
              assetImageName: "assets/images/store.png",
              onTap: () => Get.toNamed(Routes.SHARED_PREFERENCES),
            ),
            Divider(
              height: 2,
              color: dividerColor,
              thickness: 0.5,
            ),
            CustomTileWidget(
              title: 'Permission Handler',
              subTitle: "权限处理程序,向用户询问权限",
              assetImageName: "assets/images/permission.png",
              onTap: () => Get.toNamed(Routes.PERMISSION),
            ),
            Divider(
              height: 2,
              color: dividerColor,
              thickness: 0.5,
            ),
            CustomTileWidget(
              title: '图片工具',
              subTitle: "用于压缩图片、添加水印的工具类",
              assetImageName: "assets/images/image_tool.png",
              onTap: () => Get.toNamed(Routes.IMAGE_TOOL),
            ),
            Divider(
              height: 2,
              color: dividerColor,
              thickness: 0.5,
            ),
          ],
        ));
  }
}
